pub mod task_manager;

use std::sync::{OnceLock};
pub use task_manager::TaskManager;

pub mod js_bridge;
pub(crate) mod db_util;
pub(crate) mod db_migrations;
pub(crate) mod db_init;
pub(crate) mod setup_logger;
pub mod http_auth_manage;
pub mod http_client_app;
pub(crate) mod http_client;
pub(crate) mod app;
pub mod macros;
pub mod ajax_result;
pub mod page_result;
pub mod encry_util;

use tauri::AppHandle;
static GLOBAL_APP_HANDLE: OnceLock<AppHandle> = OnceLock::new();

/// 设置全局 AppHandle（仅应在应用初始化阶段调用一次）
#[allow(dead_code)]
pub fn set_global_app_handle(app: AppHandle) {
    GLOBAL_APP_HANDLE
        .set(app)
        .expect("GLOBAL_APP_HANDLE 已经被初始化过了");
}
